@import "variables";

.cbi-filebrowser {
  width: 100%;
  min-width: 210px;
  max-width: 100%;
  border: solid 1px $color-gray-lighten-70;
  border-radius: $border-radius;
  display: flex;
  flex-direction: column;
  opacity: 0;
  height: 0;
  overflow: hidden;
  padding-bottom: 2px;

  &.open {
    opacity: 1;
    height: auto;
    overflow: visible;
  }

  > * {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 0 .25em 0;
    margin: .25em .25em 0px .25em;
    white-space: nowrap;
    border-bottom: 1px solid $color-gray-lighten-70;
  }

  > div {
    border-bottom: none;
  }

  .cbi-button-positive {
    margin-right: .25em;
  }

  > ul {
    max-height: 300px;
    overflow-y: scroll;
    overflow-x: auto;

    > em {
      margin-right: 24px;
    }

    > li {
      display: flex;
      flex-direction: row;

      &:hover {
        background: #f5f5f5;
      }

      > div {
        &:first-child {
          overflow: hidden;
          text-overflow: ellipsis;
        }

        &.name {
          flex-basis: 200px;
          min-width: 200px;
        }

        &.name, &.mtime {
          margin: .1em 8px .1em 0;
        }

        &.name > a {
          font-weight: normal;
        }

        &:last-child {
          text-align: right;
          margin-right: 4px;
          margin-left: auto;

          > button {
            margin: .1em 0 .1em .25em;
            padding: 0 6px 0 6px;
            height: 16px;
            line-height: 16px;
            font-size: $base-font-size * 0.9;
          }
        }
      }

      &.cbi-filebrowser-selected {
        background-color: #e0e0e0;
        .name > a, .mtime {
          color: #606060;
          font-weight: normal !important;
        }
      }
    }
  }

  .upload {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin: 0 -.125em .25em -.125em;
    padding: 0 0 .125em 0px;
    border-bottom: 1px solid $color-gray-lighten-70;

    > * {
      margin: .125em;
      flex: 1;
    }

    > .btn {
      flex-basis: 60px;
    }

    > div {
      flex: 10;
      min-width: 150px;

      > input {
        width: 100%;
      }
    }
  }
}
